/*
 * @Author: TJN tjn@246@126.com
 * @Date: 2024-06-28 12:59:25
 * @LastEditors: TJN tjn@246@126.com
 * @LastEditTime: 2024-06-28 13:00:08
 * @FilePath: \hdcms\hdcms-nest\src\auth\current-user.decorator.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import { createParamDecorator, ExecutionContext } from '@nestjs/common';

export const CurrentUser = createParamDecorator(
  (data: unknown, ctx: ExecutionContext) => {
    const request = ctx.switchToHttp().getRequest();
    return request.user;
  },
);
